As an integration level of very large scale integrated circuits (Very Large Scale Integration, VLSI for short) becomes higher, more on-chip processing units, such as a storage unit and a signal processing unit, are integrated on a same chip, each on-chip processing unit is equivalent to one processor core, and multiple processor cores form a multi-core processor or a many-core processor. A network-on-chip (Network-on-Chip, NoC for short) is a main means for implementing data transmission between different processor cores in the multi-core processor. As the number of the processor cores becomes larger, a situation in which multiple threads of one task and multiple tasks are simultaneously operated in a same processor core is increasingly common; if threads of different tasks are randomly allocated to some processor cores, in the NoC, communication between processor cores operating different threads of a same task is affected by data streams of other tasks; in this case, quality of service (Quality of Service, QoS for short) cannot be ensured, and system performance is lowered. In order to avoid mutual interference of data streams between tasks caused by randomly allocating tasks in the NoC, a subnet division method is usually used, that is, data streams belonging to a same task are limited in a specific area of the NoC.
In the prior art, a routing table is established for each router-on-chip in the NoC, and the routing table determines a routing mechanism of transmitting a packet from a source router-on-chip to a destination router-on-chip. When subnet division is performed, it is ensured by using an internal routing algorithm that a router-on-chip that a next hop of a data stream of one task reaches is a router-on-chip allocated to a same task, and the routing algorithm is applicable to any topology, is relatively complicated, and has large hardware overheads, and a subnet in an irregular shape easily generates traffic congestion. FIG. 1 is a schematic diagram of a task allocation method based on a routing algorithm in the prior art. As shown in FIG. 1, if all other routers-on-chip in a task 5 need to communicate with a Dest, a same link needs to be used, which may cause link congestion, and affect a network throughput.